public function execute( $subPage ) {
$this->setHeaders();
$this->loadAuth( $subPage );
+
+ if ( !$this->isActionAllowed( $this->authAction ) ) {
+ if ( $this->authAction === AuthManager::ACTION_UNLINK ) {
+ // Looks like there are no linked accounts to unlink
+ $titleMessage = $this->msg( 'cannotunlink-no-provider-title' );
+ $errorMessage = $this->msg( 'cannotunlink-no-provider' );
+ throw new ErrorPageError( $titleMessage, $errorMessage );
+ } else {
+ // user probably back-button-navigated into an auth session that no longer exists
+ // FIXME would be nice to show a message
+ $this->getOutput()->redirect( $this->getPageTitle()->getFullURL( '', false, PROTO_HTTPS ) );
+ return;
+ }
+ }
+
$this->outputHeader();
$status = $this->trySubmit();
"linkaccounts": "Link accounts",
"linkaccounts-success-text": "The account was linked.",
"linkaccounts-submit": "Link accounts",
+ "cannotunlink-no-provider-title": "There are no linked accounts to unlink",
+ "cannotunlink-no-provider": "There are no linked accounts that can be unlinked.",
"unlinkaccounts": "Unlink accounts",
"unlinkaccounts-success": "The account was unlinked.",
"authenticationdatachange-ignored": "The authentication data change was not handled. Maybe no provider was configured?",
"linkaccounts": "Title of the special page [[Special:LinkAccounts]] which allows the user to connect the local user accounts with external ones such as Google or Facebook.",
"linkaccounts-success-text": "Text shown on top of the form after a successful action.",
"linkaccounts-submit": "Text of the main submit button on [[Special:LinkAccounts]] (when there is one)",
+ "cannotunlink-no-provider-title": "Error page title shown when the user visits [[Special:UnlinkAccounts]] but there is no external account that could be unlinked.",
+ "cannotunlink-no-provider": "Error message shown when the user visits [[Special:UnlinkAccounts]] but there is no external account that could be unlinked.",
"unlinkaccounts": "Title of the special page [[Special:UnlinkAccounts]] which allows the user to remove linked remote accounts.",
"unlinkaccounts-success": "Account unlinking form success message",
"authenticationdatachange-ignored": "Shown when authentication data change was unsuccessful due to configuration problems.\n\nCf. e.g. {{msg-mw|Passwordreset-ignored}}.",